#include<bits/stdc++.h>
using namespace std;

int findFinalValue(vector<int>& nums, int original)
{
    map<int, int> mp;
    for(auto i:nums)
        mp[i] = 1;
    while(mp.count(original))
        original *= 2;
    return original;
}

int main()
{
	int n, original;
	cin>>n>>original;
	vector<int> nums;
	while(cin>>n)
		nums.push_back(n);
	cout<<findFinalValue(nums, original);
	return 0;
}

